package com.bobamrz.domain;

// Generated 01.06.2013 15:30:51 by Hibernate Tools 4.0.0

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * DocType generated by hbm2java
 */
@Entity
@Table(name = "doc_type", schema = "public")
public class DocType implements java.io.Serializable {

	private long docType;
	private DocType docType_1;
	private Long level;
	private String typeName;
	private Set<DocType> docTypes = new HashSet<DocType>(0);
	private Set<DocTypeAttribute> docTypeAttributes = new HashSet<DocTypeAttribute>(
			0);
	private Set<DocumentDocType> documentDocTypes = new HashSet<DocumentDocType>(
			0);

	public DocType() {
	}

	public DocType(long docType) {
		this.docType = docType;
	}

	public DocType(long docType, DocType docType_1, Long level,
			String typeName, Set<DocType> docTypes,
			Set<DocTypeAttribute> docTypeAttributes,
			Set<DocumentDocType> documentDocTypes) {
		this.docType = docType;
		this.docType_1 = docType_1;
		this.level = level;
		this.typeName = typeName;
		this.docTypes = docTypes;
		this.docTypeAttributes = docTypeAttributes;
		this.documentDocTypes = documentDocTypes;
	}

	
	@Id
	@SequenceGenerator(name = "seqGenerator3", sequenceName = "document_doc_catalog_id")
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seqGenerator3")
	@Column(name = "doc_type", unique = true, nullable = false, precision = 10, scale = 0)
	public long getDocType() {
		return this.docType;
	}

	public void setDocType(long docType) {
		this.docType = docType;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "super_type_fk")
	public DocType getDocType_1() {
		return this.docType_1;
	}

	public void setDocType_1(DocType docType_1) {
		this.docType_1 = docType_1;
	}

	@Column(name = "level", precision = 10, scale = 0)
	public Long getLevel() {
		return this.level;
	}

	public void setLevel(Long level) {
		this.level = level;
	}

	@Column(name = "type_name", length = 200)
	public String getTypeName() {
		return this.typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "docType_1")
	public Set<DocType> getDocTypes() {
		return this.docTypes;
	}

	public void setDocTypes(Set<DocType> docTypes) {
		this.docTypes = docTypes;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "docType")
	public Set<DocTypeAttribute> getDocTypeAttributes() {
		return this.docTypeAttributes;
	}

	public void setDocTypeAttributes(Set<DocTypeAttribute> docTypeAttributes) {
		this.docTypeAttributes = docTypeAttributes;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "docType", cascade = {CascadeType.ALL})
	public Set<DocumentDocType> getDocumentDocTypes() {
		return this.documentDocTypes;
	}

	public void setDocumentDocTypes(Set<DocumentDocType> documentDocTypes) {
		this.documentDocTypes = documentDocTypes;
	}

}
